#include "Queen.hpp"
#include "CriticalException.hpp"
#include "Cell.hpp"


Queen::Queen(Chess::Color color, const Position& pos)
	: Piece(color, Piece::QUEEN, pos)
{}

Queen::~Queen()
{}

list<Position*> Queen::getPossibleCases() const
{
	if (this->isOut())
		throw new CriticalException("Bishop :: getPossibleCases : Trying to get possible cases while piece is out !");
	
	Position current = this->getCell()->getPosition();
	list<Position*> valables;
	
	Piece::up_left_diagonal(*this, valables);
	Piece::up_right_diagonal(*this, valables);
	Piece::down_left_diagonal(*this, valables);
	Piece::down_right_diagonal(*this, valables);
	Piece::left_horizontal(*this, valables);
	Piece::right_horizontal(*this, valables);
	Piece::up_vertical(*this, valables);
	Piece::down_vertical(*this, valables);
	
	return valables;
}
		
